﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SaleOnlineSystem.Controls
{
    public partial class PagingNews : System.Web.UI.UserControl
    {
        public int numofpage;
        public int currentPage;


        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                string[] listurl = Request.Url.AbsoluteUri.Split('/');
                string url = listurl[listurl.Length - 1];
                if (url == "/danhsachtin.htm")
                {

                    int n = ListNews.AllCat;
                    int size = ListNews.sizePage;
                    numofpage = (n % size == 0 ? (n / size) : (n / size) + 1);
                    currentPage = ListNews.currentPage;



                    rpt_PagingNews.DataSource = BOL.ProductManager.Instance.GetTablePagingIndex(n, ListNews.sizePage,
                                                                    ListNews.currentPage);
                    rpt_PagingNews.DataBind();

                }
            }
        }
    }
}